package com.google.code.swingonfire.component.calendar;

import java.awt.BorderLayout;

import javax.swing.JComponent;
import javax.swing.JPanel;

import com.google.code.swingonfire.border.ShadowBorder;

public class JCalendar extends JComponent
{

    private static final long serialVersionUID = 8444218474091283317L;

    private final JCalendarModel model;

    private final JPanel panel = new JPanel(new BorderLayout());
    private final JCalendarNavigation navigation;
    private final JCalendarViewport viewport;

    public JCalendar(JCalendarModel model)
    {
        super();

        this.model = model;

        setLayout(new BorderLayout());
        setBorder(ShadowBorder.create());

        navigation = new JCalendarNavigation(model);
        viewport = new JCalendarViewport(model);

        panel.add(navigation, BorderLayout.NORTH);
        panel.add(viewport, BorderLayout.CENTER);

        add(panel, BorderLayout.CENTER);
    }

}
